#include "SemanticNodeBlockOutqueue.h"

/**
 *  @fn	SemanticNodeBlockOutqueue::SemanticNodeBlockOutqueue(const SyntaxTreeNode *outqueueNodePare
 *  	nt, SemanticNode *parent)
 * 
 *  @brief	Constructor. 
 * 
 *  @author	Nikola Novak
 *  @date	6/25/2009
 * 
 *  @param	outqueueNodeParent	If non-null, the outqueue node parent.
 *  @param	parent				If non-null, the parent.
 */
SemanticNodeBlockOutqueue::SemanticNodeBlockOutqueue(const SyntaxTreeNode *outqueueNodeParent, SemanticNode *parent) : SemanticNode(parent), LabeledNode(outqueueNodeParent->Nodes->GetData(0)) {
	queueExpression = NULL;
}
/**
 *  @fn	void SemanticNodeBlockOutqueue::setQueue(SemanticNodeExpression *queue)
 * 
 *  @brief	Sets a queue. 
 * 
 *  @author	Nikola Novak
 *  @date	6/25/2009
 * 
 *  @param	queue	If non-null, the queue.
 */
void SemanticNodeBlockOutqueue::setQueue(SemanticNodeExpression *queue) {
	queueExpression = queue;
}
/**
 *  @fn	std::string SemanticNodeBlockOutqueue::toDebugString(int tab)
 * 
 *  @brief	Converts a tab to a debug string. 
 * 
 *  @author	Nikola Novak
 *  @date	6/25/2009
 * 
 *  @param	tab	The tab.
 * 
 *  @return	This object as a std::string.
 */
std::string SemanticNodeBlockOutqueue::toDebugString(int tab) {
	std::ostringstream res;
	for (int i = 0; i < tab; i++) res << DEBUG_STRING_RAZMAK;
	res << getLabelsDebugString() << ": outqueue" << std::endl;
	if (queueExpression != NULL) res << ((SemanticNode *)(queueExpression))->toDebugString(tab + 1);
	return res.str();
}
